473,544 Members | 1,951 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

creating browser tab specific cookie

29 New Member
I am working on transactional website.
I am storing transaction identifier (a unique id) in a cookie, so that I can display transaction history to user.

Now a days modern browsers support multiple tabs in same window.

I am facing a problem when user starts two different transaction in two different tabs in same browser window. I am unable to differentiate between different browser tabs, because which same cookie is getting overwritten, in both the tabs.

Is there any way by which I can create tab specific cookie? which won't be accessible in another tab? Or is there any unique identifier for tabs?

I am creating cookie using java script.
Dec 6 '09 #1
12 20585
acoder
16,027 Recognized Expert Moderator MVP
Why not reuse the same transaction id in the second tab[*], so they cannot login with two different IDs at the same time (unless they use a different browser)?

[*]check for the ID. If exists, reuse, if not create new one.
Dec 6 '09 #2
DMsy2
15 New Member
Could you encode some session identifier into the URL, so that different tab environments have different URLs.

Depending on the lifecycle of the page you could use a timestamp and then alsocheck if the page had been "backed".
Dec 6 '09 #3
udaypawar
29 New Member
@acoder
Actually, the problem is user comes to the page select product and then goes to the payment page. Now payment page is showing him 500 Rs. User opens new tab purchase a product costing 1000 Rs.

Now I am storing transaction id in a single cookie. So first cookie got overridden. In this case only one tab is valid, so he can pay for Rs. 1000 and after a payment confirmation cookie is deleted, so the transaction for the previous amount (Rs. 500) is gone away.

In many cases users go to payment page in first tab to pay 500 Rs. (Page is not refreshed so it still shows Rs. 500) but a cookie says its 1000 Rs. Transaction and sends that much to bank.

That means user submitted Rs. 500 and paid Rs. 1000 instead.
Dec 26 '09 #4
udaypawar
29 New Member
@DMsy2
I already thought of this, but the problem is I have to pass transaction id through URL. Furthermore, I am maintaining user friendly URL's, so not a good idea.

In addition, I am allowing users to navigate the entire website and come back for payment, so I have to keep track of this on all the pages (Even on static HTML pages).

Even It's very difficult to pass it using form post on all over the website.
Dec 26 '09 #5
sorokin88
3 New Member
I think you can store you data in the "window.nam e" variable. It is tab or window specific and stays the same as user moves from one page to another (until you change it using javascript).

If a user opens your site in a new tab or clicks a link to open target page in a new tab, the value won't be copied and will be empty there.
Dec 27 '09 #6
Dormilich
8,658 Recognized Expert Moderator Expert
I think you can store you data in the "window.nam e" variable.
in fact, every globally defined variable can do that.
Dec 27 '09 #7
sorokin88
3 New Member
Dormilich, I don't think every globally defined variable can survive after you click a link on the site to load another page...
Dec 27 '09 #8
Dormilich
8,658 Recognized Expert Moderator Expert
well, I doubt that window.name, resp. its content will.
Dec 27 '09 #9
sorokin88
3 New Member
It is easier to check it out than to doubt.
Dec 28 '09 #10

Sign in to post your reply or Sign up for a free account.

Similar topics

0
2059
by: collie | last post by:
Hi, I have an asp page where i created cookies-for admin and for user. The aspx page reads these cookies. Everything seems to work fine but now i have to create a new cookie if cookie has expired or if cookie is null. Also, i am having problems with the expire because if the username belongs to the admin for example and then i want to...
1
1375
by: Chak | last post by:
How easy / difficult is it to create web reports using 'XML + XSLT' ? Any examples on the web ?
15
3289
by: lawrence | last post by:
Is this the correct way to test for a method before I use it? createRange() is, I believe, an IE only method. function wrapSelectionInTag(selection, tag) { if (document.selection.createRange) { var range = document.selection.createRange(); if (range.parentElement() == element) range.text = '<' + tag + '>' + range.text + '<\/' + tag +...
0
1113
by: clintonG | last post by:
Has anybody seem any documentation or tutorials that discuss browser specific Themes? // Example <%@ Page Language="C#" IE:Theme="IeTheme" Mozilla:Theme="MozillaTheme" %> <%= Clinton Gallagher METROmilwaukee (sm) "A Regional Information Service" NET csgallagher AT metromilwaukee.com URL http://metromilwaukee.com/
5
3160
by: David Baker | last post by:
Hi all I am very new to ASP.Net. I am trying to create a sniffer for our program. We want our users to click our sniffer and hopefully the sniffer will check their computer against our requirements. I would like to ask experts like you to see which items are actually doable with ASP.Net. Below I listed all of the items we are looking for but I...
3
2237
by: Ben | last post by:
Hi, I'm sending out a session cookie. That is a cookie that has no expiration date. When I surf through the site, no problems, but if I close the browser and open it back up, the cookie is still there if other browser windows were open. Even if those windows didn't go to the site with the cookie or spawn from the browser that is visiting...
1
1219
by: quist | last post by:
Is there a way to specify browser specific themes in the web.config like you can in the page declaration of a content page? If you can't there and you can't in the master page, then you have to declare them for every content page, and that does not seem very efficient. If there is no way better way to do that, is there some way to leverage...
3
1927
by: Smokey Grindle | last post by:
Is there any way in asp.net 2.0 to say if this specific browser views my site give them a CSS sheet that is specific for that browser? like IE6 get its own, FF get its own, IE7 gets the one FF uses... something like that... this is of course... for browser compatability btw I am using ASP.NET 2.0's theme system for all my CSS right now...
13
7343
by: BLKeller | last post by:
I'm having a problem with a site I'm working on which contains links to Reporting Services reports. The pages are written in HTML and classic ASP. The links to the reports are in the following format: http://ServerName/ReportServer?ReportName&rs:FormatCommand=Render The problem occurs after I open a report from the site. Prior to opening any...
0
7449
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7642
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
7796
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
7737
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
5950
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
4938
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3440
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
1
1861
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1003
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.